package com.iqiu.cms.service;

import com.ibeetl.admin.core.service.BaseService;
import com.ibeetl.admin.core.util.PlatformException;
import com.iqiu.cms.dao.CoreUserMessageDao;
import com.iqiu.cms.entity.CoreUserMessage;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 系统消息 Service
 */

@Service
@Transactional
public class CoreUserMessageService extends BaseService<CoreUserMessage>{

    @Autowired private CoreUserMessageDao coreUserMessageDao;

    public PageQuery<CoreUserMessage> queryByCondition(PageQuery query){
        PageQuery ret =  coreUserMessageDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelCoreUserMessage(List<Long> ids){
        try {
            coreUserMessageDao.batchDelCoreUserMessageByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除系统消息失败", e);
        }
    }
}